package com.qian.ddj.pay.model;

import org.springframework.util.StringUtils;

import java.math.BigDecimal;
import java.util.Map;
import java.util.TreeMap;

public class PlaceOrder {

    private String user_id;
    private String outOrderNo;
    private String sign;
    private BigDecimal amount;
    private String other;
    private String notify;
    private String front;
    private String ip_address;
    private String shop_name;
    private String version;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getShop_name() {
        return shop_name;
    }

    public void setShop_name(String shop_name) {
        this.shop_name = shop_name;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getOutOrderNo() {
        return outOrderNo;
    }

    public void setOutOrderNo(String outOrderNo) {
        this.outOrderNo = outOrderNo;
    }

    public String getOther() {
        return other;
    }

    public void setOther(String other) {
        this.other = other;
    }

    public String getNotify() {
        return notify;
    }

    public void setNotify(String notify) {
        this.notify = notify;
    }

    public String getFront() {
        return front;
    }

    public void setFront(String front) {
        this.front = front;
    }

    public String getIp_address() {
        return ip_address;
    }

    public void setIp_address(String ip_address) {
        this.ip_address = ip_address;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }



    public Map<String, String> getMap() {
        Map<String, String> map = new TreeMap<>();
        map.put("user_id", user_id);
        map.put("outOrderNo", outOrderNo);
        if (!StringUtils.isEmpty(amount)) {
            map.put("amount", amount.toString());
        }
        map.put("notify", notify);
        if (!StringUtils.isEmpty(other)) {
            map.put("other", other);
        }
        if (!StringUtils.isEmpty(front)) {
            map.put("front", front);
        }
        if (!StringUtils.isEmpty(ip_address)) {
            map.put("ip_address", ip_address);
        }
        if (!StringUtils.isEmpty(sign)) {
            map.put("sign", sign);
        }
        if (!StringUtils.isEmpty(version)){
            map.put("version",version);
        }
        return map;
    }
}
